<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', 'UserController@user');

//用户管理中心API
Route::group(['middleware'=>'auth:api','namespace' => 'UserCenter'], function(){
    //用户中心首页
    Route::post('usercenter/indexdata','UserIndexController@indexData')->name('indexdata');
    Route::post('usercenter/realdata','UserIndexController@realData')->name('realdata');
    Route::post('usercenter/auditinfo','UserIndexController@auditinfo')->name('auditinfo');
    Route::post('usercenter/webadv','UserIndexController@webadv')->name('webadv');
    Route::post('usercenter/advinfo','UserIndexController@advinfo')->name('advinfo');
    //用户放单权限审批
    Route::post('usercenter/applyaudit','UserSubmitAuditController@applyAudit')->name('applyaudit');
    Route::post('usercenter/lastapply','UserSubmitAuditController@lastApply')->name('lastapply');
    //用户放单及商品管理
    Route::post('usercenter/checklink','UserGoodsController@checkLink')->name('checklink');
    Route::post('usercenter/savenormal','UserGoodsController@saveNormal')->name('savenormal');
    //Route::post('usercenter/createnormal','UserGoodsController@createNormal')->name('createnormal');
    //Route::post('usercenter/updatenormal','UserGoodsController@updateNormal')->name('updatenormal');
    Route::post('usercenter/savefire','UserGoodsController@saveFire')->name('savefire');
    //Route::post('usercenter/createfire','UserGoodsController@createFire')->name('createfire');
    //Route::post('usercenter/updatefire','UserGoodsController@updateFire')->name('updatefire');
    Route::post('usercenter/goodslist','UserGoodsController@goodslist')->name('goodslist');
    //Route::post('usercenter/auditing','UserGoodsController@auditing')->name('auditing');
    Route::post('usercenter/viewcopy','UserGoodsController@viewCopy')->name('viewcopy');
    Route::post('usercenter/editview','UserGoodsController@editView')->name('editview');
    //Route::post('usercenter/audited','UserGoodsController@audited')->name('audited');
    //Route::post('usercenter/refuse','UserGoodsController@refuse')->name('refuse');
    Route::post('usercenter/off','UserGoodsController@off')->name('off');
    Route::post('usercenter/delete','UserGoodsController@delete')->name('delete');
    Route::post('usercenter/tbinfo','UserGoodsController@TBInfo')->name('tbinfo');
});
//首页路由
Route::post('category','GoodsController@category')->name('category');
Route::post('fire','GoodsController@fire')->name('fire');
Route::post('kill','GoodsController@kill')->name('kill');
Route::post('killdesc','GoodsController@killDesc')->name('killdesc');
Route::post('newgoods','GoodsController@newgoods')->name('newgoods');
Route::post('ranking','GoodsController@ranking')->name('ranking');
Route::post('appointment','GoodsController@appointment')->name('appointment');
Route::post('goodsview','GoodsController@goodsView')->name('goodsview');
Route::post('search','GoodsController@search')->name('search');
Route::post('userindex','GoodsController@userindex')->name('userindex');
Route::post('testindex','TestController@index')->name('testindex');
//商品纠错路由
Route::middleware('auth:api')->post('addcorrection','GoodsCorrectionController@addCorrection')->name('addcorrection');
//获取用户appkey
Route::middleware('auth:api')->post('getappkey','UserAppKeyController@getAppKey')->name('getappkey');
Route::middleware('auth:api')->post('resetappkey','UserAppKeyController@resetAppKey')->name('resetappkey');
Route::post('checkappkey','UserAppKeyController@checkAppKey')->name('checkappkey');


Route::middleware('auth:api')->post('/userinfo','UserController@userInfo')->name('userinfo');
Route::post('/getsmscode','UserController@getSmscode')->name('getsmscode');
// Route::post('/forgotcode','UserController@forgotcode')->name('forgotcode');
// Route::post('/logincode','UserController@logincode')->name('logincode');
Route::post('/login','UserController@doLogin')->name('do_login');
Route::post('/loginbycode','UserController@doLoginCode')->name('do_login_code');
Route::post('/register','UserController@doRegister')->name('do_register');
Route::post('/resetpwd','UserController@doResetPassword')->name('resetpwd')->middleware(['auth']);
Route::post('/forgotreset','UserController@forgotReset')->name('forgotreset');
Route::post('/checkforgetcode','UserController@checkForgetcode')->name('checkforgetcode');
Route::post('/logout','UserController@logout')->name('logout')->middleware(['auth:api']);



Route::post('/image/imageUpload','ImageController@imageUpload')->middleware(['auth:api']);
Route::post('/image/moreImageUpload','ImageController@moreImageUpload')->middleware(['auth:api']);
Route::post('/region/getProvinceInfo','RegionController@getProvinceInfo');
Route::post('/region/getCity','RegionController@getCity');
Route::post('/service/getCustomerService','CustomerServiceController@getCustomerService');
Route::group(['middleware'=>['auth:api'],'prefix'=>'kill'],function(){
    //秒杀
    Route::post('checkLink','KillController@checkLink');
    Route::post('saveKillGood','KillController@saveKillGood');
    Route::post('getExamine','KillController@getExamine');
    Route::post('getKillExaminePass','KillController@getKillExaminePass');
    Route::post('LowerFrameGood','KillController@LowerFrameGood');
    Route::post('getKillRefuseGoods','KillController@getKillRefuseGoods');
    Route::post('getKillGoodInfo','KillController@getKillGoodInfo');
    Route::post('getKillData','KillController@getKillData');
    Route::post('getKillDataDynamic','KillController@getKillDataDynamic');
    Route::post('getKillRule','KillController@getKillRule');
    Route::post('getKillField','KillController@getKillField');
    Route::post('getUserKillList','KillController@getUserKillList');

});

Route::group(['middleware'=>['auth:api'],'prefix'=>'user'],function(){
    //账户资金
    Route::post('/getVoucherLogList','UsercapitalController@getVoucherLogList');
    Route::post('/getRechargeLog','UsercapitalController@getRechargeLog');
    Route::post('/getUserVoucher','UsercapitalController@getUserVoucher');
    //用户授权
    Route::post('/getUserAuth','UserAuthController@getUserAuth');
    Route::post('/addUserAuth','UserAuthController@addUserAuth');
    //用户个人信息编辑
    Route::post('/userEditInfo','UserController@userEditInfo');
    Route::post('/userEditAvatar','UserController@userEditAvatar');
    Route::post('/userEditAvatar','UserController@userEditAvatar');
    Route::post('/getUserInfo','UserController@getUserInfo');
    Route::post('/getUserIntegralInfo','UsercapitalController@getUserIntegralInfo');
    Route::post('/getUserIsSend','UsercapitalController@getUserIsSend');
    Route::post('/getUserKillStatus','KillController@getUserKillStatus');
});


Route::group(['middleware'=>['auth:api'],'prefix'=>'integral'],function(){
    //积分信息
    Route::post('/getUserIntegralLog','IntegralController@getUserIntegralLog');
    Route::post('/getIntegralRule','IntegralController@getIntegralRule');
    Route::post('/getIntegralTrajectory','IntegralController@getIntegralTrajectory');
});
Route::any('/test','KillController@test');

//开放API接口
Route::post('bursting','OpenAPIController@bursting')->name('bursting');
Route::post('seckill','OpenAPIController@seckill')->name('seckill');
Route::post('mark','OpenAPIController@mark')->name('mark');
Route::post('newly','OpenAPIController@newly')->name('newly');
Route::post('ranking','OpenAPIController@ranking')->name('ranking');
Route::post('detail','OpenAPIController@detail')->name('detail');